package top.raxidin.common.vo;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data

public class Result<T> {
    private Integer code;       //0表示成功
    private String message;
    private T data;

    private Long count;


    private Result() {
    }

    private Result(Integer code, String message, T data, Long count) {
        this.code = code;
        this.message = message;
        this.data = data;
        this.count = count;
    }

    public static Result<Object> success(){
        return new Result<>(0,"success",null,null);
    }


    public static Result<Object> fail(){
        return new Result<>(-1,"fail",null,null);
    }

    public static Result<Object> fail(String message){
        return new Result<>(-1,message,null,null);
    }


}
